namespace Headspring.Training.Core.Services.Impl
{
	public class EmailService : IEmailService
	{
		private readonly IUserSession _session;

		public EmailService(IUserSession session)
		{
			_session = session;
		}

		public void SendMessage(string emailAddress, string message)
		{
			string flashMessage = string.Format("'{0}' email sent to '{1}'", message,
			                                    emailAddress);
			var flash = new FlashMessage(FlashMessage.MessageType.Message,
			                             flashMessage);
			_session.PushUserMessage(flash);
		}
	}
}